<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>just4fun</title>
	<script language="JavaScript">
		function foo(x){
			document.getElementsByName("rightAns")[0].value = x.parentElement.parentElement.rowIndex;
			alert(document.getElementsByName("rightAns")[0].value);
			document.getElementsByName("")									
		}		
	</script>
</head>
<body>
<form action="Test" method="get">
	<input type="hidden" name="rightAns" value="0">
	<table>
		<tr><td><textarea name="1">hello1</textarea><input type="radio" name="1" onclick="foo(this)" value="1"></td></tr>
		<tr><td><textarea name="1">hello2</textarea><input type="radio" name="1" onclick="foo(this)" value="2"></td></tr>
		<tr><td><textarea name="1">hello3</textarea><input type="radio" name="1" onclick="foo(this)" value="2"></td></tr>
		<tr><td><textarea name="1">hello4</textarea><input type="radio" name="1" onclick="foo(this)" value="2"></td></tr>
		<tr><td><textarea name="1">hello5</textarea><input type="radio" name="1" onclick="foo(this)" value="2"></td></tr>
	</table>
	<input type="submit" value="提交" />
	<textarea name="foo1"></textarea>
</form>
	<script language="JavaScript">
		document.getElementsByName("foo1")[0].value = "111";
	</script>
</body>
</html>









